<template>
<onekit-page>
<onekit-view>
	<onekit-audio :src="src" id="myAudio"></onekit-audio>
	<onekit-button type="primary" @Tap="audioPlay">播放</onekit-button>
	<onekit-button type="primary" @Tap="audioPause">暂停</onekit-button>
	<onekit-button type="primary" @Tap="audio14">设置当前播放时间为14秒</onekit-button>
	<onekit-button type="primary" @Tap="audioStart">回到开头</onekit-button>
</onekit-view>
</onekit-page></template>
<script>
/* eslint-disable */
import Vue from 'vue';
const ONEKIT_JSON= {
  "navigationBarTitleText": "音频",
  "usingComponents": {
    
  }
};
const ONEKIT_SJS = {
};
import wx from '../../../../weixin2vue/wx.js';
import Macro from '../../../../weixin2vue/Macro.js';
const {getApp,getCurrentPages} = Macro;
import Page from '../../../../weixin2vue/OnekitPage.js';
import Component from '../../../../weixin2vue/OnekitComponent.js';
export default Page(ONEKIT_JSON,["src"],ONEKIT_SJS,{
    "onShareAppMessage"(){
      return {
        "title":'Audio',
        "path":'packageAPI/pages/audio/audio'
};
    },
    "onReady"(e){
      this.audioCtx = wx.createAudioContext('myAudio');
      this.audioCtx.setSrc('https://dldir1.qq.com/music/release/upload/t_mm_file_publish/2339610.m4a');
      this.audioCtx.play();
    },
    "data":{
        "src":''
},
    "audioPlay"(){
      this.audioCtx.play();
    },
    "audioPause"(){
      this.audioCtx.pause();
    },
    "audio14"(){
      this.audioCtx.seek(14);
    },
    "audioStart"(){
      this.audioCtx.seek(0);
    }
});

</script>
<style 
 lang="css">
</style>